package net.fdukedom.epicurus.messaging;

/**
 * Message pack.
 *
 * @author Dmitry Y. Kochelaev
 */
public class Message {

    /**
     * Message type.
     */
    private String type;

    /**
     * Attach to the message.
     */
    private Object attach;

    /**
     * Creates message out of type.
     *
     * @param type message's type
     */
    public Message(String type) {
        this.type = type;
    }

    /**
     * Creates instance out of type and attach.
     *
     * @param type message's type
     * @param attach message's attach
     */
    public Message(String type, Object attach) {
        this.type = type;
        this.attach = attach;
    }

    /**
     * Returns message type.
     *
     * @return message type
     */
    public final String getType() {
        return type;
    }

    /**
     * Returns attach.
     *
     * @return attach
     */
    public Object getAttach() {
        return attach;
    }

    /**
     * Sets attach.
     *
     * @param attach attach to be set
     */
    public void setAttach(Object attach) {
        this.attach = attach;
    }
}
